package com.xs.ai.entity;

import jakarta.persistence.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import org.hibernate.annotations.Type;
import com.vladmihalcea.hibernate.type.json.JsonType;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

// ==========================================
// 用户决策记录实体
// ==========================================
@Data
@Entity
@Table(name = "user_decisions")
public class UserDecision {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    
    private Long userId;
    private String decisionType; // email_priority, meeting_response, delegation等
    
    private String contextType; // email, calendar_event, task
    private Long contextId;
    
    @Type(JsonType.class)
    @Column(columnDefinition = "jsonb")
    private Map<String, Object> contextData;
    
    private String aiSuggestion;
    private String userChoice;
    private Boolean matched; // AI建议是否与用户选择一致
    
    private LocalDateTime decisionTime;
    private Integer responseTimeSeconds;
}